// ************************************************************************ //
// The types declared in this file were generated from data read from the
// WSDL File described below:
// WSDL     : http://172.21.217.9:8080/DRCP/services/DrcpService?wsdl
// Encoding : UTF-8
// Version  : 1.0
// (2007-11-27 10:07:50 - 1.33.2.5)
// ************************************************************************ //

unit DrcpSvc;

interface

uses InvokeRegistry, SOAPHTTPClient, Types, XSBuiltIns;

type

  // ************************************************************************ //
  // The following types, referred to in the WSDL document are not being represented
  // in this file. They are either aliases[@] of other types represented or were referred
  // to but never[!] declared in the document. The types from the latter category
  // typically map to predefined/known XML or Borland types; however, they could also 
  // indicate incorrect WSDL documents that failed to declare or import a schema type.
  // ************************************************************************ //
  // !:string          - "http://www.w3.org/2001/XMLSchema"
  // !:int             - "http://www.w3.org/2001/XMLSchema"
  // !:base64Binary    - "http://www.w3.org/2001/XMLSchema"
  // !:boolean         - "http://www.w3.org/2001/XMLSchema"
  // !:dateTime        - "http://www.w3.org/2001/XMLSchema"

  Label_               = class;                 { "http://webservices.minifcs.utstar.com" }
  LabelStyle           = class;                 { "http://webservices.minifcs.utstar.com" }
  SnTypeEntity         = class;                 { "http://webservices.minifcs.utstar.com" }
  Function_            = class;                 { "urn:BeanService" }
  Module               = class;                 { "urn:BeanService" }
  FunctionModule       = class;                 { "urn:BeanService" }
  PluginDO             = class;                 { "urn:BeanService" }
  User                 = class;                 { "urn:BeanService" }
  Role                 = class;                 { "urn:BeanService" }

  ArrayOfString = array of WideString;          { "http://webservices.minifcs.utstar.com" }


  // ************************************************************************ //
  // Namespace : http://webservices.minifcs.utstar.com
  // ************************************************************************ //
  Label_ = class(TRemotable)
  private
    FId: WideString;
    FName: WideString;
    FDesc: WideString;
    FPosition: WideString;
    FProductId: WideString;
    FStyleId: WideString;
    FSnTypeId: WideString;
  published
    property Id: WideString read FId write FId;
    property Name: WideString read FName write FName;
    property Desc: WideString read FDesc write FDesc;
    property Position: WideString read FPosition write FPosition;
    property ProductId: WideString read FProductId write FProductId;
    property StyleId: WideString read FStyleId write FStyleId;
    property SnTypeId: WideString read FSnTypeId write FSnTypeId;
  end;



  // ************************************************************************ //
  // Namespace : http://webservices.minifcs.utstar.com
  // ************************************************************************ //
  LabelStyle = class(TRemotable)
  private
    FId: WideString;
    FName: WideString;
    FContent: WideString;
    FDesc: WideString;
    FWidth: Integer;
    FHeight: Integer;
    FDpi: Integer;
  published
    property Id: WideString read FId write FId;
    property Name: WideString read FName write FName;
    property Content: WideString read FContent write FContent;
    property Desc: WideString read FDesc write FDesc;
    property Width: Integer read FWidth write FWidth;
    property Height: Integer read FHeight write FHeight;
    property Dpi: Integer read FDpi write FDpi;
  end;



  // ************************************************************************ //
  // Namespace : http://webservices.minifcs.utstar.com
  // ************************************************************************ //
  SnTypeEntity = class(TRemotable)
  private
    Fid: WideString;
    FclassId: WideString;
    Fname: WideString;
    Fdesc: WideString;
    FproductId: WideString;
    FrouteId: WideString;
    Fparameters: WideString;
    FlevelId: Integer;
  published
    property id: WideString read Fid write Fid;
    property classId: WideString read FclassId write FclassId;
    property name: WideString read Fname write Fname;
    property desc: WideString read Fdesc write Fdesc;
    property productId: WideString read FproductId write FproductId;
    property routeId: WideString read FrouteId write FrouteId;
    property parameters: WideString read Fparameters write Fparameters;
    property levelId: Integer read FlevelId write FlevelId;
  end;



  // ************************************************************************ //
  // Namespace : urn:BeanService
  // ************************************************************************ //
  Function_ = class(TRemotable)
  private
    Fid: WideString;
    Fname: WideString;
    FparentId: WideString;
    FtypeId: WideString;
  published
    property id: WideString read Fid write Fid;
    property name: WideString read Fname write Fname;
    property parentId: WideString read FparentId write FparentId;
    property typeId: WideString read FtypeId write FtypeId;
  end;



  // ************************************************************************ //
  // Namespace : urn:BeanService
  // ************************************************************************ //
  Module = class(TRemotable)
  private
    Fid: WideString;
    FinitString: WideString;
    Fname: WideString;
    Fparam: WideString;
    FpluginId: WideString;
  published
    property id: WideString read Fid write Fid;
    property initString: WideString read FinitString write FinitString;
    property name: WideString read Fname write Fname;
    property param: WideString read Fparam write Fparam;
    property pluginId: WideString read FpluginId write FpluginId;
  end;



  // ************************************************************************ //
  // Namespace : urn:BeanService
  // ************************************************************************ //
  FunctionModule = class(TRemotable)
  private
    Fid: WideString;
    FmoduleId: WideString;
  published
    property id: WideString read Fid write Fid;
    property moduleId: WideString read FmoduleId write FmoduleId;
  end;



  // ************************************************************************ //
  // Namespace : urn:BeanService
  // ************************************************************************ //
  PluginDO = class(TRemotable)
  private
    Fdata: TByteDynArray;
    Fdesc: WideString;
    Fid: WideString;
    Fname: WideString;
    Fversion: WideString;
  published
    property data: TByteDynArray read Fdata write Fdata;
    property desc: WideString read Fdesc write Fdesc;
    property id: WideString read Fid write Fid;
    property name: WideString read Fname write Fname;
    property version: WideString read Fversion write Fversion;
  end;



  // ************************************************************************ //
  // Namespace : urn:BeanService
  // ************************************************************************ //
  User = class(TRemotable)
  private
    FauthType: WideString;
    Fdescription: WideString;
    Fid: WideString;
    Fname: WideString;
    Fpassword: WideString;
  published
    property authType: WideString read FauthType write FauthType;
    property description: WideString read Fdescription write Fdescription;
    property id: WideString read Fid write Fid;
    property name: WideString read Fname write Fname;
    property password: WideString read Fpassword write Fpassword;
  end;



  // ************************************************************************ //
  // Namespace : urn:BeanService
  // ************************************************************************ //
  Role = class(TRemotable)
  private
    Fdescription: WideString;
    Fid: WideString;
    Fname: WideString;
  published
    property description: WideString read Fdescription write Fdescription;
    property id: WideString read Fid write Fid;
    property name: WideString read Fname write Fname;
  end;

  ArrayOf_tns2_Function = array of Function_;   { "http://172.21.217.9:8080/DRCP/services/DrcpService" }
  ArrayOf_xsd_string = array of WideString;     { "http://172.21.217.9:8080/DRCP/services/DrcpService" }
  ArrayOf_tns2_Module = array of Module;        { "http://172.21.217.9:8080/DRCP/services/DrcpService" }
  ArrayOf_tns2_PluginDO = array of PluginDO;    { "http://172.21.217.9:8080/DRCP/services/DrcpService" }
  ArrayOf_tns2_User = array of User;            { "http://172.21.217.9:8080/DRCP/services/DrcpService" }
  ArrayOf_tns2_Role = array of Role;            { "http://172.21.217.9:8080/DRCP/services/DrcpService" }

  // ************************************************************************ //
  // Namespace : http://webservice.web.presentation.minifcs.com
  // transport : http://schemas.xmlsoap.org/soap/http
  // style     : rpc
  // binding   : DrcpServiceSoapBinding
  // service   : DrcpServiceService
  // port      : DrcpService
  // URL       : http://172.21.217.9:8080/DRCP/services/DrcpService
  // ************************************************************************ //
  DrcpService = interface(IInvokable)
  ['{BDD001AA-D0E4-0144-0367-7F938F819DAA}']
    function  ClientConfig_GetContent(const host: WideString; const module: WideString): WideString; stdcall;
    procedure ClientConfig_SetContent(const host: WideString; const module: WideString; const content: WideString); stdcall;
    function  Product_GetAllIds: ArrayOfString; stdcall;
    function  Product_GetAllNames: ArrayOfString; stdcall;
    function  Product_GetNameById(const id: WideString): WideString; stdcall;
    function  SnClass_GetAllNames: ArrayOfString; stdcall;
    function  SnType_GetAllIdsByProductId(const productId: WideString): ArrayOfString; stdcall;
    function  SnType_GetId(const productId: WideString; const typeName: WideString): WideString; stdcall;
    function  SnInfo_IsExist(const sn: WideString): Boolean; stdcall;
    procedure SnLink_AddParent(const self: WideString; const parent: WideString); stdcall;
    procedure SnLink_DetachParent(const self: WideString); stdcall;
    procedure SnLink_DetachChildren(const self: WideString); stdcall;
    procedure SnLink_DetachAll(const self: WideString); stdcall;
    function  SnLink_GetParent(const self: WideString): WideString; stdcall;
    function  SnLink_GetChildren(const self: WideString): ArrayOfString; stdcall;
    function  SnLink_GetRoot(const self: WideString): WideString; stdcall;
    function  SnLink_GetDescendant(const self: WideString): ArrayOfString; stdcall;
    function  SnLink_GetRelativesAndMe(const self: WideString): ArrayOfString; stdcall;
    function  SnLink_GetRelatives(const self: WideString): ArrayOfString; stdcall;
    function  SnLink_GetAllRoots: ArrayOfString; stdcall;
    function  SnLink_IsRelative(const sn1: WideString; const sn2: WideString): Boolean; stdcall;
    function  SnLink_IsStraightRelative(const sn1: WideString; const sn2: WideString): Boolean; stdcall;
    procedure SnLink_DeleteSubTree(const root: WideString); stdcall;
    function  Station_GetId(const productId: WideString; const name: WideString): WideString; stdcall;
    function  Station_GetPluginName(const productId: WideString; const stationName: WideString): WideString; stdcall;
    function  Station_GetPluginParams(const productId: WideString; const stationName: WideString): WideString; stdcall;
    procedure Ate_SaveTestResults(const data: WideString); stdcall;
    function  Ate_GetStartTimeOfTheLatestRecord(const sn: WideString; const station: WideString): TXSDateTime; stdcall;
    function  Test(const workOrder: WideString): Integer; stdcall;
    function  Label_GetById(const id: WideString): Label_; stdcall;
    function  Label_GetNameById(const id: WideString): WideString; stdcall;
    function  Label_GetId(const productId: WideString; const labelName: WideString): WideString; stdcall;
    function  Label_GetNamesByProductId(const productId: WideString): ArrayOfString; stdcall;
    function  Label_GetStyleContentById(const labelId: WideString): WideString; stdcall;
    procedure Log_Add(const userId: WideString; const computerName: WideString; const source: WideString; const type_: Integer; const category: WideString; const action: WideString; const comment: WideString); stdcall;
    function  TextCallMethodList(const language: WideString): ArrayOfString; stdcall;
    function  Function_Get(const id: WideString): Function_; stdcall;
    function  Function_GetRoot: Function_; stdcall;
    function  Function_GetParent(const id: WideString): Function_; stdcall;
    function  Function_GetChildren(const id: WideString): ArrayOf_tns2_Function; stdcall;
    function  Function_GetPath(const id: WideString): WideString; stdcall;
    function  Function_GetAll: ArrayOf_tns2_Function; stdcall;
    function  Function_Save(const function_: Function_): WideString; stdcall;
    procedure Function_Update(const function_: Function_); stdcall;
    procedure Function_Delete(const id: WideString); stdcall;
    function  FunctionAuthorization_IsUserAuthorized(const userId: WideString; const functionId: WideString): Boolean; stdcall;
    function  FunctionAuthorization_IsRoleAuthorized(const roleId: WideString; const functionId: WideString): Boolean; stdcall;
    function  FunctionAuthorization_IsUserAuthorizedByPath(const userId: WideString; const functionPath: WideString): Boolean; stdcall;
    function  FunctionAuthorization_GetAuthorizedFunctions(const roleId: WideString): ArrayOf_tns2_Function; stdcall;
    procedure FunctionAuthorization_SetAuthorizedFunctions(const roleId: WideString; const functionIds: ArrayOf_xsd_string); stdcall;
    function  Module_Get(const id: WideString): Module; stdcall;
    function  Module_GetByFunctionId(const functionId: WideString): Module; stdcall;
    function  Module_GetAll: ArrayOf_tns2_Module; stdcall;
    procedure Module_Save(const module: Module); stdcall;
    procedure Module_Update(const module: Module); stdcall;
    procedure Module_Delete(const moduleId: WideString); stdcall;
    function  FunctionModule_IsModule(const functionId: WideString): Boolean; stdcall;
    function  FunctionModule_GetModuleByFunctionId(const functionId: WideString): Module; stdcall;
    procedure FunctionModule_SaveOrUpdate(const functionModule: FunctionModule); stdcall;
    procedure FunctionModule_Delete(const functionId: WideString); stdcall;
    function  Login(const userId: WideString; const password: WideString): Boolean; stdcall;
    procedure SnInfo_IncreasePrintCountBySns(const sns: ArrayOfString); stdcall;
    procedure SnLink_AddChilren(const self: WideString; const children: ArrayOfString); stdcall;
    function  LabelStyle_GetContentById(const id: WideString): WideString; stdcall;
    procedure LabelStyle_Delete(const id: WideString); stdcall;
    function  LabelStyle_Get(const id: WideString): LabelStyle; stdcall;
    function  LabelStyle_GetAllIds: ArrayOfString; stdcall;
    function  LabelStyle_GetIdByName(const name: WideString): WideString; stdcall;
    procedure RouteUpdate(const sns: ArrayOfString; const stationId: WideString; const result: WideString); stdcall;
    procedure Product_GetById(const id: WideString; var Product_GetByIdResult: Boolean; var name: WideString); stdcall;
    function  Product_GetId(const name: WideString): WideString; stdcall;
    function  GenerateSn(const generatorName: WideString; const paramList: WideString; const qty: Integer): ArrayOfString; stdcall;
    procedure SnClass_GetByName(const name: WideString; var SnClass_GetByNameResult: Boolean; var id: WideString; var verify: WideString; var desc: WideString; var paramNames: WideString; var generatorId: WideString); stdcall;
    procedure SnType_GetById(const id: WideString; var SnType_GetByIdResult: Boolean; var e: SnTypeEntity); stdcall;
    function  SnType_GetNameById(const id: WideString): WideString; stdcall;
    function  SnType_GetClassIdById(const id: WideString): WideString; stdcall;
    function  SnType_GetParamsById(const id: WideString): WideString; stdcall;
    function  SnType_GetVerify(const id: WideString): WideString; stdcall;
    procedure SnType_UpdateParamsById(const id: WideString; const parameters: WideString); stdcall;
    procedure SnGenerator_GetNameById(const id: WideString; var SnGenerator_GetNameByIdResult: Boolean; var name: WideString); stdcall;
    procedure SnInfo_GetBySn(const sn: WideString; var SnInfo_GetBySnResult: Boolean; var instanceId: WideString; var partNumber: WideString; var partClass: WideString; var revision: WideString; var workOrder: WideString; var status: Integer; var printCount: Integer); stdcall;
    function  SnInfo_GetTypeIdBySn(const sn: WideString): WideString; stdcall;
    function  SnInfo_GetPartNumberBySn(const sn: WideString): WideString; stdcall;
    function  SnInfo_GetRevisionBySn(const sn: WideString): WideString; stdcall;
    function  SnInfo_GetWorkOrderBySn(const sn: WideString): WideString; stdcall;
    function  SnInfo_GetPartClassBySn(const sn: WideString): WideString; stdcall;
    function  SnInfo_GetSnsByTypeAndPrintCount(const typeId: WideString; const printCount: Integer): ArrayOfString; stdcall;
    procedure SnInfo_Insert(const sn: WideString; const typeId: WideString; const partNumber: WideString; const partClass: WideString; const revision: WideString; const workOrder: WideString; const status: Integer; const printCount: Integer); stdcall;
    procedure SnInfo_BatchInsert(const sns: ArrayOfString; const typeId: WideString; const partNumber: WideString; const partClass: WideString; const revision: WideString; const workOrder: WideString; const status: Integer; const printCount: Integer); stdcall;
    function  SnInfo_UpdateSnTypeIdBySn(const sn: WideString; const snTypeId: WideString): Integer; stdcall;
    procedure Plugin_GetById(const id: WideString; var name: WideString; var version: WideString; var desc: WideString; var data: TByteDynArray); stdcall;
    function  Plugin_Get(const id: WideString): PluginDO; stdcall;
    function  Plugin_GetAll(const fetchData: Boolean): ArrayOf_tns2_PluginDO; stdcall;
    procedure Plugin_GetByName(const name: WideString; var version: WideString; var desc: WideString; var data: TByteDynArray); stdcall;
    function  Plugin_GetNameById(const id: WideString): WideString; stdcall;
    function  Plugin_GetVersionByName(const name: WideString): WideString; stdcall;
    function  Plugin_GetDataByName(const name: WideString): TByteDynArray; stdcall;
    procedure Plugin_InsertOrUpdateByName(const name: WideString; const version: WideString; const desc: WideString; const data: TByteDynArray); stdcall;
    function  Station_GetStationListByProductName(const productName: WideString): ArrayOfString; stdcall;
    procedure LabelStyle_Insert(const e: LabelStyle); stdcall;
    procedure LabelStyle_Update(const e: LabelStyle); stdcall;
    procedure RouteCheck(const sns: ArrayOfString; const stationId: WideString; var RouteCheckResult: Boolean; var msg: WideString); stdcall;
    function  GetStationId(const sn: WideString; const stationName: WideString): WideString; stdcall;
    function  GetAvailableNextStations(const sn: WideString): ArrayOfString; stdcall;
    procedure TextCall(const methodName: WideString; const inParams: ArrayOfString; var TextCallResult: Integer; var outParams: ArrayOfString); stdcall;
    function  GlobalVariable_GetValue(const key: WideString): WideString; stdcall;
    procedure GlobalVariable_SetValue(const key: WideString; const value: WideString); stdcall;
    function  User_Login(const userId: WideString; const password: WideString): Boolean; stdcall;
    function  User_Get(const id: WideString): User; stdcall;
    function  User_GetAll: ArrayOf_tns2_User; stdcall;
    procedure User_Save(const user: User); stdcall;
    procedure User_Update(const user: User); stdcall;
    procedure User_Delete(const id: WideString); stdcall;
    function  UserRole_GetRoleList(const userId: WideString): ArrayOf_tns2_Role; stdcall;
    procedure UserRole_SetRoleList(const userId: WideString; const roleIdList: ArrayOf_xsd_string); stdcall;
    procedure Role_Delete(const id: WideString); stdcall;
    function  Role_Get(const id: WideString): Role; stdcall;
    function  Role_GetAll: ArrayOf_tns2_Role; stdcall;
    function  Role_Save(const role: Role): WideString; stdcall;
    procedure Role_Update(const role: Role); stdcall;
  end;

function GetDrcpService(UseWSDL: Boolean=System.False; Addr: string=''; HTTPRIO: THTTPRIO = nil): DrcpService;


implementation

function GetDrcpService(UseWSDL: Boolean; Addr: string; HTTPRIO: THTTPRIO): DrcpService;
const
  defWSDL = 'http://172.21.217.9:8080/DRCP/services/DrcpService?wsdl';
  defURL  = 'http://172.21.217.9:8080/DRCP/services/DrcpService';
  defSvc  = 'DrcpServiceService';
  defPrt  = 'DrcpService';
var
  RIO: THTTPRIO;
begin
  Result := nil;
  if (Addr = '') then
  begin
    if UseWSDL then
      Addr := defWSDL
    else
      Addr := defURL;
  end;
  if HTTPRIO = nil then
    RIO := THTTPRIO.Create(nil)
  else
    RIO := HTTPRIO;
  try
    Result := (RIO as DrcpService);
    if UseWSDL then
    begin
      RIO.WSDLLocation := Addr;
      RIO.Service := defSvc;
      RIO.Port := defPrt;
    end else
      RIO.URL := Addr;
  finally
    if (Result = nil) and (HTTPRIO = nil) then
      RIO.Free;
  end;
end;


initialization
  InvRegistry.RegisterInterface(TypeInfo(DrcpService), 'http://webservice.web.presentation.minifcs.com', 'UTF-8');
  InvRegistry.RegisterDefaultSOAPAction(TypeInfo(DrcpService), '');
  InvRegistry.RegisterExternalParamName(TypeInfo(DrcpService), 'Log_Add', 'type_', 'type');
  InvRegistry.RegisterExternalParamName(TypeInfo(DrcpService), 'Function_Save', 'function_', 'function');
  InvRegistry.RegisterExternalParamName(TypeInfo(DrcpService), 'Function_Update', 'function_', 'function');
  RemClassRegistry.RegisterXSInfo(TypeInfo(ArrayOfString), 'http://webservices.minifcs.utstar.com', 'ArrayOfString');
  RemClassRegistry.RegisterXSClass(Label_, 'http://webservices.minifcs.utstar.com', 'Label_', 'Label');
  RemClassRegistry.RegisterXSClass(LabelStyle, 'http://webservices.minifcs.utstar.com', 'LabelStyle');
  RemClassRegistry.RegisterXSClass(SnTypeEntity, 'http://webservices.minifcs.utstar.com', 'SnTypeEntity');
  RemClassRegistry.RegisterXSClass(Function_, 'urn:BeanService', 'Function_', 'Function');
  RemClassRegistry.RegisterXSClass(Module, 'urn:BeanService', 'Module');
  RemClassRegistry.RegisterXSClass(FunctionModule, 'urn:BeanService', 'FunctionModule');
  RemClassRegistry.RegisterXSClass(PluginDO, 'urn:BeanService', 'PluginDO');
  RemClassRegistry.RegisterXSClass(User, 'urn:BeanService', 'User');
  RemClassRegistry.RegisterXSClass(Role, 'urn:BeanService', 'Role');
  RemClassRegistry.RegisterXSInfo(TypeInfo(ArrayOf_tns2_Function), 'http://172.21.217.9:8080/DRCP/services/DrcpService', 'ArrayOf_tns2_Function');
  RemClassRegistry.RegisterXSInfo(TypeInfo(ArrayOf_xsd_string), 'http://172.21.217.9:8080/DRCP/services/DrcpService', 'ArrayOf_xsd_string');
  RemClassRegistry.RegisterXSInfo(TypeInfo(ArrayOf_tns2_Module), 'http://172.21.217.9:8080/DRCP/services/DrcpService', 'ArrayOf_tns2_Module');
  RemClassRegistry.RegisterXSInfo(TypeInfo(ArrayOf_tns2_PluginDO), 'http://172.21.217.9:8080/DRCP/services/DrcpService', 'ArrayOf_tns2_PluginDO');
  RemClassRegistry.RegisterXSInfo(TypeInfo(ArrayOf_tns2_User), 'http://172.21.217.9:8080/DRCP/services/DrcpService', 'ArrayOf_tns2_User');
  RemClassRegistry.RegisterXSInfo(TypeInfo(ArrayOf_tns2_Role), 'http://172.21.217.9:8080/DRCP/services/DrcpService', 'ArrayOf_tns2_Role');

end.